package com.yunji.coupon.provide;

import com.yunji.coupon.bo.CouponAmtBO;
import com.yunji.coupon.bo.UseCouponBO;
import com.yunji.coupon.business.CouponBusiness;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * @author : peter-zhu
 * @date : 2024/10/21 10:45
 * @description : TODO
 **/
@Component
public class CouponProvide {

    @Resource
    private CouponBusiness couponBusiness;

    public boolean useCoupon(UseCouponBO bo) {
        return couponBusiness.useCoupon(bo);
    }

    public CouponAmtBO getCouponAmtById(Long couponId, BigDecimal orderSaleAmt) {
        return couponBusiness.getCouponAmtById(couponId, orderSaleAmt);
    }

    public boolean backCoupon(Long orderId) {
        return couponBusiness.backCoupon(orderId);
    }
}
